using System;
using System.Collections;
using System.Collections.Generic;
using UI;
using UnityEngine;
using UnityEngine.UI;

public class DialogToButton : MonoBehaviour
{
    public string leftButtonName;
    public string rightButtonName;
    private UI_ButtonSelectPanel UIButtonSelectPanel;
    
    private UI_ScenarioPanel UIScenarioPanel;

    private bool isExecute;

    public string LeftScenarioName;
    public int LeftScenarioId;
    public string RightScenarioName;
    public int RightScenarioId;
    private void Start()
    {
        UIScenarioPanel=GameObject.Find("ScenarioPanel(Clone)").GetComponent<UI_ScenarioPanel>();
    }
    
    private void Update()
    {
        if (UIScenarioPanel.scenarioFinish&&!isExecute)
        {
            UIController.Instance.Show<UI_ButtonSelectPanel>();

            UIButtonSelectPanel=GameObject.Find("ButtonSelectPanel(Clone)").GetComponent<UI_ButtonSelectPanel>();
            UIButtonSelectPanel.setName(leftButtonName,rightButtonName);
           
            UIButtonSelectPanel.LeftButtonSet(LeftScenarioId,LeftScenarioName);
            UIButtonSelectPanel.RightButtonSet(RightScenarioId,RightScenarioName);
            
            isExecute = true;
        }
    }
}
